/**
 * api测试用例入口
 *
 * Created by snowingsea on 2020/01/22.
 */
const health = require('./../models/health');
const Administrator = require('./../models/administrator');

module.exports = describe('Test API', function () {
  let userTotalNumber = 0;
  const administrator = new Administrator();

  before(function (done) {
    health.ping()
      .then(() => administrator.login())
      .then(() => administrator.getUserTotalNumber())
      .then((totalNumber) => {
        userTotalNumber = totalNumber;
        done();
      })
      .catch(done);
  });
  after(function (done) {
    administrator.getUserTotalNumber()
      .then((totalNumber) => {
        totalNumber.should.be.eql(userTotalNumber);
        done();
      })
      .catch(done);
  });

  require('./health');
  require('./auth');
  require('./me');
  require('./administrator');
  require('./tester');
});
